package com.hsgene.product.service.api;

import com.hsgene.common.util.result.ApiResult;
import com.hsgene.coupon.dto.GeneticDiscountDto;
import com.hsgene.product.service.api.impl.DiscountCouponServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 优惠券Controller
 *
 * @author wangbing
 * @version 1.0, 2018/10/11
 */
@FeignClient(name = "ms-mod-discount", path = "/v1.0/genetic/testing/discounts", fallback = DiscountCouponServiceImpl.class)
public interface DiscountCouponService {

    /**
     * 查询当前有效的优惠券列表
     *
     * @param userId   用户id
     * @param platform
     * @return 优惠券列表
     */
    @GetMapping("")
    ApiResult<List<GeneticDiscountDto>> queryEffectiveDiscount(
            @RequestParam(name = "platform") Integer platform,
            @RequestParam(name = "userId", required = false) String userId);
}
